package com.wanmait.server.controller;

import com.wanmait.model.entity.Staff;
import org.apache.shiro.SecurityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;

/**
 * @ClassName AbstractController
 * @Author 羽
 * @Date 2020/12/8  19:54
 * @Version 1.0
 * 摘要，封装的方法
 **/
@Controller
public abstract class AbstractController {
    //日志
    protected Logger log = LoggerFactory.getLogger(getClass());

    //获取当前登录用户的一些信息
    protected Staff getLoginStaffInfo(){
        return (Staff) SecurityUtils.getSubject().getPrincipal();
    }
    //获取登陆用户的id
    protected int getLoginStaffId(){
        return getLoginStaffInfo().getId();
    }












}
